package com.bestsoft.web.controller.flow;

import java.util.List;

import com.bestsoft.flow.domain.FlowOrderDt;
import com.bestsoft.flow.domain.FlowOrderDt2;
import com.bestsoft.flow.domain.FlowZsDt;
import com.bestsoft.flow.service.IFlowOrderDtService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bestsoft.common.core.controller.BaseController;
import com.bestsoft.common.core.domain.AjaxResult;
import com.bestsoft.common.core.page.TableDataInfo;

/**
 * 用户订单明细Controller
 * 
 * @author ruoyi
 * @date 2023-08-28
 */
@RestController
@RequestMapping("/system/dt")
public class FlowOrderDtController extends BaseController
{
    @Autowired
    private IFlowOrderDtService flowOrderDtService;

    /**
     * 查询用户订单明细列表
     */
    @PreAuthorize("@ss.hasPermi('system:dt:list')")
    @GetMapping("/list")
    public TableDataInfo list(FlowOrderDt flowOrderDt)
    {
        startPage();
        List<FlowOrderDt> list = flowOrderDtService.selectFlowOrderDtList(flowOrderDt);
        return getDataTable(list);
    }

    /**
     * 获取用户订单明细详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:dt:query')")
    @GetMapping(value = "/{orderId}")
    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
    {
        return success(flowOrderDtService.selectFlowOrderDtByOrderId(orderId));
    }

    /**
     * 查询追溯明细列表erp
     */
    @PreAuthorize("@ss.hasPermi('system:dt:listerp')")
    @GetMapping("/listerp")
    public TableDataInfo list(Long orderId)
    {
//        System.out.println("11:::"+orderId);
        List<FlowOrderDt2> list = flowOrderDtService.selectFlowOrderDtListErp(orderId);
//        System.out.println(list);
        return getDataTable(list);
    }

}
